package com.by.autoconfig;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * 增加 拦截器注册的相关参数 如  拦截路径 白名单
 */
@ConfigurationProperties(prefix = "token.interceptor")
public class LoginInteceptorProperties {

    private final String DEFAULT_PATH="/**"; //默认拦截路劲

    /**
     * 登录拦截器拦截的路径
     */
    List<String> pathPatterns;

    /**
     * 登录拦截器白名单，不拦截的路径
     */
    List<String> excludePathPatterns;

    public LoginInteceptorProperties(){
      pathPatterns=new ArrayList<>();
      pathPatterns.add(DEFAULT_PATH);
      excludePathPatterns=new ArrayList<>();
    }

    public List<String> getPathPatterns() {
        return pathPatterns;
    }

    public void setPathPatterns(List<String> pathPatterns) {
        this.pathPatterns = pathPatterns;
    }

    public List<String> getExcludePathPatterns() {
        return excludePathPatterns;
    }

    public void setExcludePathPatterns(List<String> excludePathPatterns) {
        this.excludePathPatterns = excludePathPatterns;
    }
}
